package com.koi.pojo.system;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author ･ᴗ･
 * @description [字典数据表模型]
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_dict_data")
public class SysDictData implements Serializable {

    /**
     * 字典编码
     */
    @TableId(value = "dict_id", type = IdType.ASSIGN_ID)
    private Long dictId;

    /**
     * 字典标签
     */
    @NotBlank(message = "字典标签不能为空")
    @TableField(value = "dict_label")
    private String dictLabel;

    /**
     * 字典键值
     */
    @NotBlank(message = "字典键值不能为空")
    @TableField(value = "dict_value")
    private String dictValue;

    /**
     * 字典类型
     */
    @NotBlank(message = "字典类型不能为空")
    @TableField(value = "dict_type")
    private String dictType;

    /**
     * 字典状态[0启用 1停用]
     */
    @NotBlank(message = "字典状态不能为空")
    @TableField(value = "dict_status")
    private String dictStatus;

    /**
     * ElementPlus官方颜色[默认-primary]
     */
    @TableField(value = "dict_tag")
    private String dictTag;

    /**
     * tags自定义背景颜色[有值会进行覆盖ElementPlus官方颜色][例如：16进制或者pink等]
     */
    @TableField(value = "dict_color")
    private String dictColor;

    /**
     * 显示顺序
     */
    @NotNull(message = "显示顺序不能为空")
    @TableField(value = "sorted")
    private Integer sorted;

    /**
     * 创建者
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 更新者
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

}
